package com.wyman.context.event;

import com.wyman.beans.factory.BeanFactory;
import com.wyman.context.ApplicationEvent;
import com.wyman.context.ApplicationListener;


/**
 * @Author 李伟民
 * @Description
 * @DateTime 2024/12/18 01:23
 */
public class SimpleApplicationEventMulticaster extends AbstractApplicationEventMulticaster{

    public SimpleApplicationEventMulticaster(BeanFactory beanFactory){
        setBeanFactory(beanFactory);
    }

    @Override
    public void multicastEvent(ApplicationEvent event) {
        for(ApplicationListener listener:getApplicationListeners(event)){
            listener.onApplicationEvent(event);
        }
    }
}
